<template>
  <div v-if="Object.keys(showitem).length !==0" class="recommend">
    <div class="imgallinfo"  v-for="(item,index) in showitem " :key="item+index">
      <div class="iteminfo">
      <div class="img"><img :src="item.image"></div>
      <div class="cellall"><span >{{item.title}}</span></div>
      <div class="price"><span class="currtprice">￥{{item.price}}</span><span class="collect">{{item.cfav}}</span></div> 
      </div> 
    </div> 
  </div>
   
</template>

<script>
export default {
  name:'childenrecommend',
  props: {
    showitem:{
      type:Array,
     default(){
       return []
     }
    }
  }
}
</script>

<style  scoped>
.recommend{
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap; 
 justify-content: space-around;
}
.imgallinfo{
  width: 45vw;
  height: 300px;
  margin-top: 15px;
}
.imgallinfo img{
    width: 45vw;
    height: 250px;
    border-radius: 5px;
    margin-bottom: 3px;
   

}
.img{
  width: 42vw;
}
.cellall{
  width: 45vw;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  font-weight: bolder;
   margin-top: 5px;
}
.price{
 margin-top: 5px;
}
.currtprice{
  color:var(--color-text);
  font-size:18px;
  margin-right: 15px;
}
.collect::before{
   content: '';
   width: 16px;
   height: 16px;
   display: inline-block;
   background-image:url('~assets/img/detail/icon03.png');
   position: relative;
   right: 3px;
  
}
</style>